//This do-file reproduces all regressions reported in Table 8

version 14
use "data/reg_mun_elections.dta" , clear	

local controls0 
local controls1 age gender l_stay urban bgy_pop nb_families 
local controls2 `controls1' edu_*
local controls3 `controls2' occ_* occ1_*
local controls4 `controls3' pcinc poor  	
		
local append replace
foreach x in    win_margin  turnout {

	su `x'
	local mean=r(mean)
	
	xtreg `x'  herf_community_edge   , fe cluster(group_mun) 
	outreg2 using "results/table_8",  addstat("Mean Dep. Var." , `mean') 2aster   bdec(2) sdec(2)    nocons keep(herf_community_edge )  `append'
	local append append
	xtreg `x'  herf_community_edge `controls4'  , fe cluster(group_mun) 
	outreg2 using "results/table_8",  addstat("Mean Dep. Var." , `mean') 2aster  bdec(2) sdec(2)    nocons keep(herf_community_edge )  `append'
}
